// eslint-disable-next-line
import { UserLayout, BasicLayout } from '@/layouts'
import { menu, chart, print, setting } from '@/core/icons'

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '' },
    redirect: '/Dashboard',
    children: [
      {
        path: '/Dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard'),
        meta: { title: 'Dashboard', keepAlive: false, icon: menu },
        hideChildrenInMenu: true,
        children: [
          {
            hidden: true,
            path: '/Dashboard/create',
            name: 'DashboardCreate',
            component: () => import('@/views/dashboard/create'),
            meta: { title: 'Dashboard > Create new ideation', keepAlive: false, icon: menu }
          },
          {
            hidden: true,
            path: '/Dashboard/create-form',
            name: 'DashboardCreateForm',
            component: () => import('@/views/dashboard/create-form'),
            meta: { title: 'Dashboard > Create new ideation', keepAlive: false, icon: menu }
          },
          {
            hidden: true,
            path: '/Dashboard/edit',
            name: 'DashboardEdit',
            component: () => import('@/views/dashboard/edit'),
            meta: { title: 'Dashboard > Edit ideation', keepAlive: false, icon: menu }
          },
          {
            hidden: true,
            path: '/Dashboard/edit-form',
            name: 'DashboardEditForm',
            component: () => import('@/views/dashboard/edit-form'),
            meta: { title: 'Dashboard > Edit ideation', keepAlive: false, icon: menu }
          },
          {
            hidden: true,
            path: '/Dashboard/answer',
            name: 'DashboardAnswer',
            component: () => import('@/views/dashboard/answer'),
            meta: { title: 'Dashboard > Answer ideation', keepAlive: false, icon: menu }
          }
        ]
      },
      {
        path: '/Templates',
        name: 'Templates',
        component: () => import('@/views/template'),
        meta: { title: 'Templates', keepAlive: false, icon: chart }
      },
      {
        path: '/Reports',
        name: 'Reports',
        component: () => import('@/views/reports'),
        hideChildrenInMenu: true,
        meta: { title: 'Reports', keepAlive: false, icon: print },
        children: [
          {
            path: '/Reports/detail',
            name: 'ReportsDetail',
            component: () => import('@/views/reports/detail'),
            meta: { title: 'Reports > View report ', keepAlive: false, icon: print }
          }
        ]
      },
      {
        path: '/Settings',
        name: 'Settings',
        component: () => import('@/views/setting'),
        meta: { title: 'Settings', keepAlive: false, icon: setting }
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
